package com.qianbudai.koklinlearning

import com.qianbudai.koklinlearning.mvp.BaseActivity
import com.qianbudai.koklinlearning.presenter.UserContract
import com.qianbudai.koklinlearning.presenter.UserPresenter

class MainActivity : BaseActivity(), UserContract.IUserView {

    /*override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)


    }*/
    override val mPresenter: UserPresenter = UserPresenter(this)

    override fun getLayoutId(): Int = R.layout.activity_main

    override fun initView() {
        tvUser.setOnClickListener {
            mPresenter.addUser("卡丽熙")
        }
    }



    override fun showAddUserResult(boolean: Boolean) {
        if (boolean){
            tvUser.text = "添加用户成功"
        }else{
            tvUser.text = "添加用户失败"

        }
    }
}
